﻿using SuperSocket.SocketBase.Protocol;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SuperSocketServer.SSBase
{
    public class MyRequestInfo : IRequestInfo
    {

        public MyRequestInfo(byte[] header, byte[] body)
        {
            Key = ((header[0] * 256) + header[1]).ToString();
            Data = body;
        }

        /// <summary>
        /// key
        /// </summary>
        public string Key { get; set; }


        /// <summary>
        /// 正文字节码
        /// </summary>
        public byte[] Data { get; set; }


        /// <summary>
        /// 正文字符串
        /// </summary>
        public string Body
        {
            get { return Encoding.UTF8.GetString(Data); }

        }
    }
}
